<!--
Copyright 2013 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!DOCTYPE html><meta charset="UTF-8">
<style>
#container {
  -webkit-column-width: 250px;
  -moz-column-width: 250px;
  column-width: 250px;
}

p {
  display: inline-block;
}

.test, .ref {
  background-color: lightsteelblue;
  display: inline-block;
  width: 100px;
  height: 100px;
  margin-right: 10px;
}

#borderWidth, #borderColor {
  border-style: solid;
}
#borderWidth {
  border-color: green;
}

</style>
<script>
var expected_failures = [
  {
    browser_configurations: [{ firefox: true }],
    tests: ['#font at t=(0|500|1000|1500|2000)ms'],
    message: 'Floating point issues.',
  }, {
    browser_configurations: [{ firefox: true }],
    tests: ['#background at t=(0|500|1000|1500|2000)ms'],
    message: 'Setting background to "auto" gets back "auto auto".',
  }, {
    browser_configurations: [{ msie: true }],
    tests: [
      '#((?!(borderWidth|borderRadius|margin|padding)).*) at t=(0|500|1000|1500|2)ms',
      '#borderWidth at t=(500|1000|1500)ms',
    ],
    message: 'IE returns rgba.',
  }, {
    browser_configurations: [{ chrome: true, version: '30|31' }],
    tests: ['#font'],
    message: 'Different initial font-size.',
  }
];
</script>
<script src="../bootstrap.js"></script>
<div id="container"></div>
<script>
"use strict";

var testCases = {
  background: 'url(background.png) 50% 25% repeat-y green',
  border: 'green solid 4px',
  borderColor: 'lime lightgreen darkgreen green',
  borderLeft: 'green solid 4px',
  borderRight: 'green solid 4px',
  borderTop: 'green solid 4px',
  borderBottom: 'green solid 4px',
  borderRadius: '10px 20px 10% 50%',
  borderWidth: 'thin medium thick 10px',
  font: 'italic bold 20pt / 200% serif',
  margin: '5px 10px 15px 20px',
  outline: 'green solid 5px',
  padding: '5px 10px 15px 20px',
};

var container = document.querySelector('#container');

for (var shorthand in testCases) {
  var p = document.createElement('p');
  var value = testCases[shorthand];
  p.appendChild(document.createTextNode(shorthand));
  p.appendChild(document.createElement('br'));
  var refDiv = document.createElement('div');
  refDiv.id = shorthand;
  refDiv.style[shorthand] = value;
  refDiv.className = 'ref';
  refDiv.appendChild(document.createTextNode('Ref'));
  p.appendChild(refDiv);
  var testDiv = document.createElement('div');
  testDiv.id = shorthand;
  testDiv.className = 'test';
  testDiv.appendChild(document.createTextNode('Test'));
  p.appendChild(testDiv);
  container.appendChild(p);

  var keyframe = {};
  keyframe[shorthand] = value;
  document.timeline.play(new Animation(testDiv, [keyframe], {duration: 2 * 1000, fill: 'forwards'}));
}

</script>
